package reflection.hashcode;

public class BasePojo {

	protected Long id;
	protected String name;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "id=" + id + ": name=" + name;
	}

	@Override
	public boolean equals(Object obj) {

		if (obj == null) {
			return false;
		} else if (this == obj) {
			return true;
		} else if (!this.getClass().equals(obj.getClass()))
		{
			return false;
		}

		BasePojo object = (BasePojo) obj;
		
		return this.id.equals(object.getId());
	}
}
